import request from '@/utils/request'

export function getList(params) {
  return request({
    url: '/core/dataset/list',
    method: 'get',
    params
  })
}

export const del = (id) => request.delete('/core/dataset/delete?id=' + id, {

})

export const add = (data) => request({
  url: '/core/dataset/create',
  method: 'post',
  data: data
})

export const update = (data) => request({
  url: '/core/dataset/update',
  method: 'put',
  data: data
})

//获取appId对应的应用详情
// export const detail = (params) => request({
//     url: '/core/app/detail',
//     method: 'get',
//     params
//   })

  //知识库文件列表
  export const collection_list = (data) => request({
    url: '/core/dataset/collection/list',
    method: 'post',
    data: data
  })

  //新增知识库文件
  export const add_collection = (data) => request({
    url: '/core/dataset/collection/create',
    method: 'post',
    data: data
  })

  //编辑知识库文件
  export const update_collection = (data) => request({
    url: '/core/dataset/collection/update',
    method: 'post',
    data: data
  })

  //删除知识库文件
  export const del__collection = (id) => request.delete('/core/dataset/collection/delete?collectionId=' + id, {

  })

  //获取知识库文件详情
  export const detail = (params) => request({
    url: '/core/dataset/collection/detail',
    method: 'get',
    params
  })

   //知识库文件数据列表
   export const data_list = (data) => request({
    url: '/core/dataset/data/list',
    method: 'post',
    data: data
  })

  //知识库文件数据新增
  export const data_add = (data) => request({
    url: '/core/dataset/data/insertData',
    method: 'post',
    data: data
  })

   //知识库文件数据更新
   export const data_update = (data) => request({
    url: '/core/dataset/data/update',
    method: 'put',
    data: data
  })

  //删除知识库文件数据
  export const data_del = (id) => request.delete('/core/dataset/data/delete?dataId=' + id, {

  })
  